package rateexchange.client.place;

import rateexchange.shared.RateProxy;

import com.google.gwt.place.shared.Place;
import com.google.gwt.place.shared.PlaceTokenizer;

// Editing or adding new rate State.
public class RatePlace extends Place{
	
	public static String REQ  = "req";
    public static String RATE = "rate";
    
    private String token;
    private RateProxy rate;
    
    public RatePlace(String token){
    	this.token = token;
    }
    
    public RateProxy getRate(){
    	return rate;
    }
    
    //to set the Proxy in case of editing
    public void setRate(RateProxy rate){
    	this.rate = rate;
    }
    
    public String getToken() {
        return token;
    }
    
    public static class Tokenizer implements PlaceTokenizer<RatePlace>{

		@Override
		public RatePlace getPlace(String token) {
			return new RatePlace(token);
		}

		@Override
		public String getToken(RatePlace place) {
			return place.getToken();
		}
    	
    }
    
}
